package PTA.Mianxiangduixiang.ex44;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;
class Person{
     String name="none";
     int age=1;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    Person(){

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person [name=" + name + ", age=" + age + "]";
    }
}
public class ex44 {
    public static void main(String[] args) {
        Scanner sc=  new Scanner(System.in);
        int n = sc.nextInt();
Person []p = new Person[n];
int i=0;
while(i<n){
   p[i]=new Person(sc.next(),sc.nextInt());
   i++;
}
int j=0;
String s = sc.next();
while(j<i) {
    System.out.println(p[j++].toString());
}
    j=0;
    int flag=0;
    while(j<i){
        if(s.equals(p[j].name)){
            flag=1;
            System.out.println("查询结果:");
            System.out.println(p[j].toString());
            break;
        }
        j++;
    }
    if(flag==0){
        System.out.println("not found");
    }


    }
}
